home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / lang / PPCsmalltalk.lha / PPCSmallTalk / docs / manbody < prev    next >
Text File  |  1986-10-19  |  28KB  |  1,350 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  AAAA LLLLiiiittttttttlllleeee SSSSmmmmaaaallllllllttttaaaallllkkkk UUUUsssseeeerrrr MMMMaaaannnnuuuuaaaallll
  11.  
  12.  
  13.                         Timothy A. Budd
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.   _1.  _I_n_t_r_o_d_u_c_t_i_o_n
  21.  
  22.        This manual is intended as an aid in using  the  Little
  23.   Smalltalk  system.   It  is  not  intended  to be used as an
  24.   introduction to the Smalltalk language.  Little Smalltalk is
  25.   largely (with exceptions listed in a later section) a subset
  26.   of  the  Smalltalk-80*  language  described  in  [.Smalltalk
  27.   blue.].   A  complete description of the classes included in
  28.   the Little Smalltalk system and the messages they accept  is
  29.   given in Appendix 1.
  30.  
  31.   _2.  _R_u_n_n_i_n_g _t_h_e _s_y_s_t_e_m
  32.  
  33.        The Little Smalltalk system is invoked  by  typing  the
  34.   command  sssstttt.   The system is interactive - that is, the user
  35.   types an expression at the keyboard and the system  responds
  36.   by  evaluating  the  expression  and typing the result.  For
  37.   example, typing the expression 3333 ++++ 4444 results in the value  7777
  38.   being  displayed  on the output.  Execution is terminated by
  39.   typing control-D.  A sample execution session  is  shown  in
  40.   Figure 1.
  41.  
  42.  
  43.                         % st
  44.                         Little Smalltalk
  45.                                 3 + 4
  46.                         7
  47.                                 ^D
  48.                         %
  49.  
  50.  
  51.           FFFFiiiigggguuuurrrreeee 1111:::: A Sample Little Smalltalk Session
  52.  
  53.  
  54.        Instance variables for the command level can be created
  55.   by  assigning  a  value  to a new variable name.  Thereafter
  56.   that variable can be used at the command level, although  it
  57.   is  not  known within the scope of any method.  The variable
  58.   _________________________
  59.   * Smalltalk-80 is a trademark of the Xerox Corporation.
  60.  
  61.  
  62.  
  63.  
  64.                        September 19, 1986
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                              - 2 -
  71.  
  72.  
  73.   ``last'' always contains the  value  returned  by  the  last
  74.   expression  typed.   Figure  2 shows the creation of a vari-
  75.   able.  Note that the assignment arrow is  formed  as  a  two
  76.   character sequence.
  77.  
  78.  
  79.                     newvar <- 2 / 3
  80.                     newvar
  81.                0.666667
  82.                     2 raisedTo: newvar + (4 / 3)
  83.                4
  84.                     last
  85.                4
  86.  
  87.  
  88.                   FFFFiiiigggguuuurrrreeee 2222:::: Creating Variables
  89.  
  90.  
  91.        The default behavior is for the value  of  expressions,
  92.   with the exception of assignments, to be typed automatically
  93.   as they are evaluated.  This behavior can be modified either
  94.   by  using the -d flag (see Appendix 2), or by passing a mes-
  95.   sage to the pseudo variable ssssmmmmaaaallllllllttttaaaallllkkkk (see Appendix 1).
  96.  
  97.        Class descriptions must be read  in  from  files,  they
  98.   cannot  be  entered  interactively.   Class descriptions are
  99.   entered using a system directive.  For example, to include a
  100.   class description contained in a file named nnnneeeewwwwccccllllaaaassssssss....sssstttt, the
  101.   following system directive should be issued:
  102.  
  103.                          )i newclass.st
  104.  
  105.   A list of files containing class descriptions  can  also  be
  106.   given as arguments to the st command.  The command
  107.  
  108.                       %st file1 ... filen
  109.   is equivalent to the sequence
  110.  
  111.                         %st
  112.                         Little Smalltalk
  113.                              )i file1
  114.                              ...
  115.                              )i filen
  116.  
  117.        A table of system directives is given in Figure 3.
  118.  
  119.        Note that the )e system directive invokes an editor  on
  120.   a file containing class descriptions, and then automatically
  121.   includes the file when the editor is  exited.  Classes  also
  122.   respond to the message eeeeddddiiiitttt, which will have the same effect
  123.   as the )e directive applied to the file containing the class
  124.   description.    Thus   the  typical  debug/edit/debug  cycle
  125.  
  126.  
  127.  
  128.                        September 19, 1986
  129.  
  130.  
  131.  
  132.  
  133.  
  134.                              - 3 -
  135.  
  136.  
  137.  
  138.  
  139.   _____________________________________________________________
  140.  
  141.    )e filename
  142.                  Edit the named file.   The  Little  Smalltalk
  143.                  system  will  suspend, leaving the user in an
  144.                  editor for making changes to the named  file.
  145.                  Upon  leaving  the editor the named file will
  146.                  automatically  be  included,  as  if  the  )i
  147.                  directive had been typed.
  148.  
  149.    )g filename
  150.                  Search for an entry  in  the  system  library
  151.                  area  matching  the  filename.  If found, the
  152.                  class descriptions in the library  entry  are
  153.                  included.    This   command   is  useful  for
  154.                  including commonly used classes that are  not
  155.                  part of the standard prelude, such as classes
  156.                  for statistics applications or graphics.
  157.  
  158.    )i filename
  159.                  Include  the  named  file.   The  file   must
  160.                  contain  one or more class descriptions.  The
  161.                  class  descriptions  are   parsed,   and   if
  162.                  syntactically  legal  new  instances of class
  163.                  CCCCllllaaaassssssss are added to the Smalltalk system.
  164.  
  165.    )l filename
  166.                  Load a previously saved environment from  the
  167.                  named   file.   The  current  values  of  all
  168.                  variables are overridden.  The file must have
  169.                  been created using the )s directive (below).
  170.  
  171.    )r filename
  172.                  Read the named file.  The file  must  contain
  173.                  Smalltalk  statements,  as  would be typed at
  174.                  the keyboard.  The effect is just as  if  the
  175.                  lines  of  the  file  had  been  typed at the
  176.                  keyboard.   The  file  cannot  contain  class
  177.                  descriptions.
  178.  
  179.    )s filename
  180.                  Save the current state  in  the  named  file.
  181.                  The  values  of  all variables are saved, and
  182.                  can later be reloaded using the )l  directive
  183.                  (above).
  184.  
  185.    )!string
  186.                  Execute the remainder of the  line  following
  187.                  the  exclamation  point  as  a Unix* command.
  188.                  Nothing  is  done  with  the  output  of  the
  189.                  command,  nor  is the returning status of the
  190.                  command recorded.
  191.  
  192.   _____________________________________________________________
  193.   ||||||||||||||||||||||||||||||||||||||||||||||
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.                                                                ||||||||||||||||||||||||||||||||||||||||||||||
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.                   FFFFiiiigggguuuurrrreeee 3333:::: System Directives
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.                        September 19, 1986
  292.  
  293.  
  294.  
  295.  
  296.  
  297.                              - 4 -
  298.  
  299.  
  300.   involves repeated uses of the )e directive or the eeeeddddiiiitttt  mes-
  301.   sage  until  a  desired  outcome  is  achieved.   The editor
  302.   invoked by the )e directive can be changed  by  setting  the
  303.   EDITOR variable in the users environment.
  304.  
  305.   _3.  _D_i_f_f_e_r_e_n_c_e_s _b_e_t_w_e_e_n _L_i_t_t_l_e _S_m_a_l_l_t_a_l_k _a_n_d _t_h_e  _S_m_a_l_l_t_a_l_k-
  306.   _8_0 _s_y_s_t_e_m
  307.  
  308.        This section  describes  the  differences  between  the
  309.   language  accepted  by  the  Little Smalltalk system and the
  310.   language described in  [.Smalltalk  blue.].   The  principal
  311.   reasons for these changes are as follows:
  312.  
  313.   size  Classes which are largely unnecessary, or which  could
  314.         be  easily  simulated  by other classes (e.g. Associa-
  315.         tion, SortedCollection) have been  eliminated  in  the
  316.         interest  of  keeping the size of the standard library
  317.         as smal